﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

#if SILVERLIGHT
using System.Windows.Media;
using GameEngineSL.SilverlightCompatibility;
#else
using System.Drawing;
#endif

namespace GameEngine.Worlds
{
    public class Walker : Force, ITick
    {
        public Walker(Accelerator parent)
            : base(parent)
        {
            Destination = new PointF();
        }

        /// <summary>
        /// The Walker will try to move towards this point
        /// </summary>
        public PointF Destination { get; set; }

        /// <summary>
        /// Ammount of energy available for walking (in joule).
        /// </summary>
        public float EnergyReserve { get; set; }

        /// <summary>
        /// Determines how fast the walker restores energy (in J/s).
        /// </summary>
        public float EnergyRestorationSpeed { get; set; }

        /// <summary>
        /// Maximum ammount of energy that can be stored (in joule).
        /// </summary>
        public float EnergyReserveMax { get; set; }

        /// <summary>
        /// Rate at which energy can be transformed into motion (in J/s).
        /// </summary>
        public float Power { get; set; }

        public new void Tick(float seconds)
        {
            PointF dist = new PointF(
                Destination.X - Parent.Position.X,
                Destination.Y - Parent.Position.Y);
            ForceVector = dist;

            base.Tick(seconds);
        }
    }
}
